package com.mmt.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.expression.TypeConverter;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import com.mmt.mapper.ConversationMapper;
import com.mmt.po.Message;
import com.mmt.po.User;
import com.mmt.service.ConversationService;

@Service
public class ConversationServiceImpl implements ConversationService{

	@Autowired
	private ConversationMapper conversationMapper;
	
	@Override
	public List<User> listContactByUserId(Integer userId) {
		return conversationMapper.listContactByUserId(userId);
	}
	
	@Override
	public List<Message> listMessageByConversationId(Integer conversation_id) {
		System.out.println(conversation_id);
		return conversationMapper.listMessageByConversationId(conversation_id);
	}
	
	@Override
	public int saveMessage(Message message){
		return conversationMapper.saveMessage(message);
	}

}
